package com.cf.mvp.sample.mvp.presenter;

import com.cf.mvp.mvp.BasePresenter;
import com.cf.mvp.sample.mvp.contract.MainContract;
import com.cf.mvp.sample.mvp.model.MainModel;


/**
 * @author yangji
 */
public class MainPresenter extends BasePresenter<MainModel, MainContract.View> implements MainContract.Presenter {

    @Override
    public void login(String name, String pwd) {
        getModel().requestLogin(name, pwd);
    }

    @Override
    public void requestSuccess(Object object) {
        if (object == null) {
            getMvpView().loginFailed();
        } else {
            getMvpView().loginSuccess();
        }
    }
}
